// 智能清单系统类型定义

export interface SmartListRule {
  id: string
  name: string
  type: 'time' | 'status' | 'custom'
  condition: {
    field: string
    operator: 'equals' | 'contains' | 'before' | 'after' | 'between'
    value: any
  }[]
  priority: number // 规则优先级，数字越小优先级越高
}

export interface SmartList {
  id: string
  name: string
  icon: string
  color: string
  type: 'system' | 'smart' | 'custom'
  rules?: SmartListRule[]
  isAutoUpdate: boolean // 是否自动更新任务分类
  taskCount?: number
}

// 时间维度的智能分类
export interface TimeBasedCategory {
  today: boolean
  tomorrow: boolean
  thisWeek: boolean
  overdue: boolean
  upcoming: boolean
}

// 状态维度的智能分类
export interface StatusBasedCategory {
  completed: boolean
  pending: boolean
  important: boolean
  hasReminder: boolean
  hasDeadline: boolean
}

// 任务智能分类结果
export interface TaskClassification {
  taskId: string
  categories: string[] // 任务所属的清单ID列表
  timeCategory: TimeBasedCategory
  statusCategory: StatusBasedCategory
  lastUpdated: Date
}

// 清单统计信息
export interface ListStatistics {
  listId: string
  totalTasks: number
  completedTasks: number
  pendingTasks: number
  overdueTasks: number
  todayTasks: number
  importantTasks: number
  lastUpdated: Date
}

// 智能分类配置
export interface SmartClassificationConfig {
  enableAutoClassification: boolean
  timeZone: string
  workingHours: {
    start: string // HH:mm 格式
    end: string   // HH:mm 格式
  }
  weekendDays: number[] // 0-6，0为周日
  importantKeywords: string[] // 用于识别重要任务的关键词
}